//#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>

int main()
{
  printf("process is running,only me! pid:%d,ppid:%d\n",getpid(),getppid());
  pid_t id = fork();
  if(id==-1) return 1;
  else if(id==0)
  {
    while(1)
    {
      printf("i am child process,pid:%d,ppid:%d\n",getpid(),getppid());
      sleep(2); 
    }
  }
  else
  {
    while(1)
    {
      printf("i am father process,pid:%d,ppid:%d\n",getpid(),getppid());
      sleep(2);
    }
  }
  return 0;
}
